#ifndef SEQUENCEMODEL_H
#define SEQUENCEMODEL_H

#include <QAbstractListModel>

#include "sequenceitem.h"

class SequenceEventList;
class SequenceItem;

class SequenceModel : public QAbstractListModel
{
   Q_OBJECT
public:
   explicit SequenceModel( QList<SequenceItem *> & eventList, QObject *parent = 0);

private:
   QList< SequenceItem *> & m_eventList;

public:
   virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
   virtual QVariant data(const QModelIndex &index, int role) const;
   virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
   virtual bool removeRows(int row, int count, const QModelIndex & parent = QModelIndex());
   virtual bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count,
                         const QModelIndex &destinationParent, int destinationChild);
   virtual Qt::ItemFlags flags(const QModelIndex &index) const;
   virtual bool setData(const QModelIndex &index, const QVariant &value, int role);

   void addSequenceItem( SequenceItem *item);

public slots:
   void createEmptyItem();

private:
   void moveRows(int sourceRow, int count, int destinationRow);
};

#endif // SEQUENCEMODEL_H
